home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / GSRC208A.ZIP / COMMDLG.H < prev    next >
C/C++ Source or Header  |  1992-04-06  |  13KB  |  319 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * commdlg.h -   Common dialog functions, types, and definitions               *
  4. *                                                                             *
  5. *               Version 1.0                                                   *
  6. *                                                                             *
  7. *               NOTE: windows.h must be #included first                       *
  8. *                                                                             *
  9. *               Copyright (c) 1992, Microsoft Corp.  All rights reserved.     *
  10. *                                                                             *
  11. \*****************************************************************************/
  12.  
  13. #ifndef _INC_COMMDLG
  14. #define _INC_COMMDLG
  15.  
  16. #ifndef RC_INVOKED
  17. #pragma pack(1)         /* Assume byte packing throughout */
  18. #endif /* !RC_INVOKED */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {            /* Assume C declarations for C++ */
  22. #endif  /* __cplusplus */
  23.  
  24. #ifndef WINAPI          /* If not included with 3.1 headers... */
  25. #define WINAPI      FAR PASCAL
  26. #define CALLBACK    FAR PASCAL
  27. #define LPCSTR      LPSTR
  28. #define UINT        WORD
  29. #define LPARAM      LONG
  30. #define WPARAM      WORD
  31. #define LRESULT     LONG
  32. #define HMODULE     HANDLE
  33. #define HINSTANCE   HANDLE
  34. #define HLOCAL      HANDLE
  35. #define HGLOBAL     HANDLE
  36. #endif  /* _INC_WINDOWS */
  37.  
  38. typedef struct tagOFN
  39. {
  40.     DWORD   lStructSize;
  41.     HWND    hwndOwner;
  42.     HINSTANCE hInstance;
  43.     LPCSTR  lpstrFilter;
  44.     LPSTR   lpstrCustomFilter;
  45.     DWORD   nMaxCustFilter;
  46.     DWORD   nFilterIndex;
  47.     LPSTR   lpstrFile;
  48.     DWORD   nMaxFile;
  49.     LPSTR   lpstrFileTitle;
  50.     DWORD   nMaxFileTitle;
  51.     LPCSTR  lpstrInitialDir;
  52.     LPCSTR  lpstrTitle;
  53.     DWORD   Flags;
  54.     UINT    nFileOffset;
  55.     UINT    nFileExtension;
  56.     LPCSTR  lpstrDefExt;
  57.     LPARAM  lCustData;
  58.     UINT    (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  59.     LPCSTR  lpTemplateName;
  60. }   OPENFILENAME;
  61. typedef OPENFILENAME FAR* LPOPENFILENAME;
  62.  
  63. BOOL    WINAPI GetOpenFileName(OPENFILENAME FAR*);
  64. BOOL    WINAPI GetSaveFileName(OPENFILENAME FAR*);
  65. int     WINAPI GetFileTitle(LPCSTR, LPSTR, UINT);
  66.  
  67. #define OFN_READONLY                 0x00000001
  68. #define OFN_OVERWRITEPROMPT          0x00000002
  69. #define OFN_HIDEREADONLY             0x00000004
  70. #define OFN_NOCHANGEDIR              0x00000008
  71. #define OFN_SHOWHELP                 0x00000010
  72. #define OFN_ENABLEHOOK               0x00000020
  73. #define OFN_ENABLETEMPLATE           0x00000040
  74. #define OFN_ENABLETEMPLATEHANDLE     0x00000080
  75. #define OFN_NOVALIDATE               0x00000100
  76. #define OFN_ALLOWMULTISELECT         0x00000200
  77. #define OFN_EXTENSIONDIFFERENT       0x00000400
  78. #define OFN_PATHMUSTEXIST            0x00000800
  79. #define OFN_FILEMUSTEXIST            0x00001000
  80. #define OFN_CREATEPROMPT             0x00002000
  81. #define OFN_SHAREAWARE               0x00004000
  82. #define OFN_NOREADONLYRETURN         0x00008000
  83. #define OFN_NOTESTFILECREATE         0x00010000
  84.  
  85. /* Return values for the registered message sent to the hook function
  86.  * when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  87.  * filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  88.  * up no warning (returned when the app has already put up a warning
  89.  * message), and OFN_SHAREWARN puts up the default warning message
  90.  * for sharing violations.
  91.  *
  92.  * Note:  Undefined return values map to OFN_SHAREWARN, but are
  93.  *        reserved for future use.
  94.  */
  95.  
  96. #define OFN_SHAREFALLTHROUGH     2
  97. #define OFN_SHARENOWARN          1
  98. #define OFN_SHAREWARN            0
  99.  
  100. typedef struct tagCHOOSECOLOR
  101. {
  102.     DWORD   lStructSize;
  103.     HWND    hwndOwner;
  104.     HWND    hInstance;
  105.     COLORREF rgbResult;
  106.     COLORREF FAR* lpCustColors;
  107.     DWORD   Flags;
  108.     LPARAM  lCustData;
  109.     UINT    (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  110.     LPCSTR  lpTemplateName;
  111. } CHOOSECOLOR;
  112. typedef CHOOSECOLOR FAR *LPCHOOSECOLOR;
  113.  
  114. BOOL    WINAPI ChooseColor(CHOOSECOLOR FAR*);
  115.  
  116. #define CC_RGBINIT               0x00000001
  117. #define CC_FULLOPEN              0x00000002
  118. #define CC_PREVENTFULLOPEN       0x00000004
  119. #define CC_SHOWHELP              0x00000008
  120. #define CC_ENABLEHOOK            0x00000010
  121. #define CC_ENABLETEMPLATE        0x00000020
  122. #define CC_ENABLETEMPLATEHANDLE  0x00000040
  123.  
  124. typedef struct tagFINDREPLACE
  125. {
  126.     DWORD    lStructSize;            /* size of this struct 0x20 */
  127.     HWND     hwndOwner;              /* handle to owner's window */
  128.     HINSTANCE hInstance;             /* instance handle of.EXE that
  129.                                       * contains cust. dlg. template
  130.                                       */
  131.     DWORD    Flags;                  /* one or more of the FR_?? */
  132.     LPSTR    lpstrFindWhat;          /* ptr. to search string    */
  133.     LPSTR    lpstrReplaceWith;       /* ptr. to replace string   */
  134.     UINT     wFindWhatLen;           /* size of find buffer      */
  135.     UINT     wReplaceWithLen;        /* size of replace buffer   */
  136.     LPARAM   lCustData;              /* data passed to hook fn.  */
  137.     UINT    (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  138.                                      /* ptr. to hook fn. or NULL */
  139.     LPCSTR   lpTemplateName;         /* custom template name     */
  140. } FINDREPLACE;
  141. typedef FINDREPLACE FAR *LPFINDREPLACE;
  142.  
  143. #define FR_DOWN                         0x00000001
  144. #define FR_WHOLEWORD                    0x00000002
  145. #define FR_MATCHCASE                    0x00000004
  146. #define FR_FINDNEXT                     0x00000008
  147. #define FR_REPLACE                      0x00000010
  148. #define FR_REPLACEALL                   0x00000020
  149. #define FR_DIALOGTERM                   0x00000040
  150. #define FR_SHOWHELP                     0x00000080
  151. #define FR_ENABLEHOOK                   0x00000100
  152. #define FR_ENABLETEMPLATE               0x00000200
  153. #define FR_NOUPDOWN                     0x00000400
  154. #define FR_NOMATCHCASE                  0x00000800
  155. #define FR_NOWHOLEWORD                  0x00001000
  156. #define FR_ENABLETEMPLATEHANDLE         0x00002000
  157. #define FR_HIDEUPDOWN                   0x00004000
  158. #define FR_HIDEMATCHCASE                0x00008000
  159. #define FR_HIDEWHOLEWORD                0x00010000
  160.  
  161. HWND    WINAPI FindText(FINDREPLACE FAR*);
  162. HWND    WINAPI ReplaceText(FINDREPLACE FAR*);
  163.  
  164. typedef struct tagCHOOSEFONT
  165. {
  166.     DWORD           lStructSize;        /* */
  167.     HWND            hwndOwner;          /* caller's window handle   */
  168.     HDC             hDC;                /* printer DC/IC or NULL    */
  169.     LOGFONT FAR*    lpLogFont;          /* ptr. to a LOGFONT struct */
  170.     int             iPointSize;         /* 10 * size in points of selected font */
  171.     DWORD           Flags;              /* enum. type flags         */
  172.     COLORREF        rgbColors;          /* returned text color      */
  173.     LPARAM          lCustData;          /* data passed to hook fn.  */
  174.     UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  175.                                         /* ptr. to hook function    */
  176.     LPCSTR          lpTemplateName;     /* custom template name     */
  177.     HINSTANCE       hInstance;          /* instance handle of.EXE that
  178.                                          * contains cust. dlg. template
  179.                                          */
  180.     LPSTR           lpszStyle;          /* return the style field here 
  181.                                          * must be LF_FACESIZE or bigger */
  182.     UINT            nFontType;          /* same value reported to the EnumFonts
  183.                                          * call back with the extra FONTTYPE_ 
  184.                                          * bits added */
  185.     int             nSizeMin;           /* minimum pt size allowed & */
  186.     int             nSizeMax;           /* max pt size allowed if    */
  187.                                         /* CF_LIMITSIZE is used      */
  188. } CHOOSEFONT;
  189. typedef CHOOSEFONT FAR *LPCHOOSEFONT;
  190.  
  191. BOOL WINAPI Ch